package com.example.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.example.entity.SysUser;
import com.example.mapper.SysUserMapper;
import com.example.service.ISysLoginService;

@Service
public class SysLoginServiceImpl implements ISysLoginService {

	@Autowired
	private SysUserMapper sysUserMapper;

	@Cacheable(value = "sysUsers", keyGenerator = "wiselyKeyGenerator")
	@Override
	public List<SysUser> getSysUsers() {
		return sysUserMapper.selectList(new EntityWrapper<SysUser>());
	}

	@Cacheable(value = "sysUsers", key = "'getSysUsersPage'")
	@Override
	public List<SysUser> getSysUsersPage(Page<SysUser> page) {
		System.out.println(11);
		return sysUserMapper.selectPage(page, null);
	}

}
